package com.zzjson.client;

import com.zzjson.api.IHelloService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * <p>****************************************************************************</p>
 * <p><b>Copyright © 2010-2020 shuncom team All Rights Reserved<b></p>
 * <ul style="margin:15px;">
 * <li>Description : com.zzjson.client</li>
 * <li>Version     : 1.0.0</li>
 * <li>Creation    : 2020年02月23日</li>
 * <li>@author     : zzy0_0</li>
 * </ul>
 * <p>****************************************************************************</p>
 */
public class App {
	public static void main(String[] args) {
	/*	RpcProxyClient rpcProxyClient = new RpcProxyClient();
		IHelloService iHelloService = rpcProxyClient.clientProxy(IHelloService.class, "localhost", 8080);
		String s = iHelloService.sayHello("hello");
		System.out.println("return result: " + s);*/

		ApplicationContext context = new AnnotationConfigApplicationContext(SpringConfig.class);
		RpcProxyClient proxyClient = context.getBean(RpcProxyClient.class);

		IHelloService iHelloService = proxyClient.clientProxy(IHelloService.class, "localhost", 8080);
		String s = iHelloService.sayHello("hello");
		System.out.println("return result: " + s);
	}
}
